-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Add labels for root parent object #14578
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Scott Fleener <[email protected]>
e57df5a to
1d643ee
Compare
alpeb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
I guess the path forward is to remove the old logic along with its labels. If so, can you flag that in the the the labels.go's label entry godoc? Should also be mentioned in the release notes.
The GroupVersionResource requires the resource to be both lowercase and plural. Signed-off-by: Scott Fleener <[email protected]>
Signed-off-by: Scott Fleener <[email protected]>
|
I don't think 'kind' is sufficient. I think we must also include 'group' |
Signed-off-by: Scott Fleener <[email protected]>
Signed-off-by: Scott Fleener <[email protected]>
Co-authored-by: Alejandro Pedraza <[email protected]>
|
I added in the group as an annotation, as well as some more webhook tests to make sure we have more coverage here. |
This replaces the old pod owner mechanism with the new one introduced by #14578. This retains the previous annotations for now, we can remove them later in a follow-up. Signed-off-by: Scott Fleener <[email protected]>
This replaces the old pod owner mechanism with the new one introduced by #14578. This retains the previous annotations for now, we can remove them later in a follow-up. Signed-off-by: Scott Fleener <[email protected]>
This replaces the old pod owner mechanism with the new one introduced by #14578. This retains the previous annotations for now, we can remove them later in a follow-up. Signed-off-by: Scott Fleener <[email protected]>
This replaces the old pod owner mechanism with the new one introduced by #14578. This retains the previous annotations for now, we can remove them later in a follow-up. Signed-off-by: Scott Fleener <[email protected]>
* chore(inject): Replace root owner mechanism This replaces the old pod owner mechanism with the new one introduced by #14578. This retains the previous annotations for now, we can remove them later in a follow-up. Signed-off-by: Scott Fleener <[email protected]> * chore(inject): Remove version from root owner labels Signed-off-by: Scott Fleener <[email protected]> * chore(tests): Update goldens Signed-off-by: Scott Fleener <[email protected]> --------- Signed-off-by: Scott Fleener <[email protected]>
This reverts commit f2989ea Signed-off-by: Scott Fleener <[email protected]>
This reverts commit f2989ea Signed-off-by: Scott Fleener <[email protected]>
* Revert "chore(inject): Replace root owner mechanism (#14593)" This reverts commit 9f5201e. * Revert "feat: Add labels for root parent object (#14578)" This reverts commit f2989ea Signed-off-by: Scott Fleener <[email protected]> --------- Signed-off-by: Scott Fleener <[email protected]>
This is a roll-forward of #14578, albiet with a slightly different implementation. The original PR would fall back to direct metadata API calls when getting resources from the informer cache. This instead resyncs the informer when a resource cannot be found and tries again, skipping the direct metadata API entirely. Original PR description: Currently, we add a label that identifies the parent resource that a proxy is attached to, usually a deployment, statefulset, daemonset, etc. These are populated via `linkerd.io/proxy-<resource>`` annotations, with a different label for each parent resource. There are a few deficiencies with the current implementation. Currently, the implementation is specialized to only built-in k8s resources, so things like argocd rollouts will not appear. Additionally it does not recurse beyond two levels, so any more levels of parenting will not be captured. This adds a set of new labels, `linkerd.io/proxy-root-parent` and `linkerd.io/proxy-root-parent-kind`, and `linkerd.io/proxy-root-parent-group`, that identify the name and kind of the root parent of a proxy workload. It also correctly recurses to the true root resource, at least as far as cluster role permissions for the proxy injector permit. Note that the proxy already consumes all of the pod labels via the downward API, so there's no changes required to the proxy injector templates. Signed-off-by: Scott Fleener <[email protected]>
This is a roll-forward of #14578, albiet with a slightly different implementation. The original PR would fall back to direct metadata API calls when getting resources from the informer cache. This instead resyncs the informer when a resource cannot be found and tries again, skipping the direct metadata API entirely. Original PR description: Currently, we add a label that identifies the parent resource that a proxy is attached to, usually a deployment, statefulset, daemonset, etc. These are populated via `linkerd.io/proxy-<resource>`` annotations, with a different label for each parent resource. There are a few deficiencies with the current implementation. Currently, the implementation is specialized to only built-in k8s resources, so things like argocd rollouts will not appear. Additionally it does not recurse beyond two levels, so any more levels of parenting will not be captured. This adds a set of new labels, `linkerd.io/proxy-root-parent` and `linkerd.io/proxy-root-parent-kind`, and `linkerd.io/proxy-root-parent-group`, that identify the name and kind of the root parent of a proxy workload. It also correctly recurses to the true root resource, at least as far as cluster role permissions for the proxy injector permit. Note that the proxy already consumes all of the pod labels via the downward API, so there's no changes required to the proxy injector templates. Signed-off-by: Scott Fleener <[email protected]>
Currently, we add a label that identifies the parent resource that a proxy is attached to, usually a deployment, statefulset, daemonset, etc. These are populated via
linkerd.io/proxy-<resource>annotations, with a different label for each parent resource.There are a few deficiencies with the current implementation. Currently, the implementation is specialized to only built-in k8s resources, so things like argocd rollouts will not appear. Additionally it does not recurse beyond two levels, so any more levels of parenting will not be captured.
This adds a pair of new labels,
linkerd.io/proxy-root-parentandlinkerd.io/proxy-root-parent-kind, that identify the name and kind of the root parent of a proxy workload. It also correctly recurses to the true root resource, at least as far as cluster role permissions for the proxy injector permit.Note that the proxy already consumes all of the pod labels via the downward API, so there's no changes required to the proxy injector templates.